<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <meta>
  <!-- Stylesheets -->
  <link href="../web.css" type="text/css" rel="stylesheet"></link>
  <link href="../pygmentize.css" type="text/css" rel="stylesheet"></link>
  <title>VLFeat - Documentation - C API</title>
  <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>

  <!-- Scripts-->
  
 </meta>

 <!-- Body Start -->
 <body>
  <div id="header">
   <!-- Google CSE Search Box Begins -->
   <form action="http://www.vlfeat.org/search.html" method="get" id="cse-search-box" enctype="application/x-www-form-urlencoded">
    <div>
     <input type="hidden" name="cx" value="003215582122030917471:oq23albfeam"></input>
     <input type="hidden" name="cof" value="FORID:11"></input>
     <input type="hidden" name="ie" value="UTF-8"></input>
     <input type="text" name="q" size="31"></input>
     <input type="submit" name="sa" value="Search"></input>
    </div>
   </form>
   <script src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en" xml:space="preserve" type="text/javascript"></script>
   <!-- Google CSE Search Box Ends -->
   <h1><a shape="rect" href="../index.html" class="plain"><span id="vlfeat">VLFeat</span><span id="dotorg">.org</span></a></h1>
  </div>
  <div id="headbanner">
   Documentation - C API
  </div>
  <div id="pagebody">
   <div id="sidebar"> <!-- Navigation Start -->
    <ul>
<li><a href="../index.html">Home</a>
</li>
<li><a href="../download.html">Download</a>
</li>
<li><a href="../doc.html">Documentation</a>
<ul>
<li><a href="../mdoc/mdoc.html">Matlab API</a>
</li>
<li><a href="index.html" class='active' >C API</a>
</li>
<li><a href="../man/man.html">Man pages</a>
</li>
</ul></li>
<li><a href="../overview/tut.html">Tutorials</a>
</li>
<li><a href="../applications/apps.html">Applications</a>
</li>
</ul>

   </div> <!-- sidebar -->
   <div id="content">
    
    <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>
    <div class="doxygen">
<div>
<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dsift.c File Reference</div>  </div>
</div>
<div class="contents">

<p>Dense SIFT - Definition.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="dsift_8h.html">dsift.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="pgm_8h.html">pgm.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="mathop_8h.html">mathop.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="imopv_8h.html">imopv.h</a>&quot;</code><br/>
<code>#include &lt;math.h&gt;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#a9a99d480cf025b9f19cc3e3ee5b010c4">_vl_dsift_new_kernel</a> (int binSize, int numBins, int binIndex, double windowSize)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize new convolution kernel.  <a href="#a9a99d480cf025b9f19cc3e3ee5b010c4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#a79f9ffc851983f7e26f09b9ed1c43813">_vl_dsift_normalize_histogram</a> (float *begin, float *end)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Normalize histogram.  <a href="#a79f9ffc851983f7e26f09b9ed1c43813"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#a85a2ddc18108b83931d3cb7c66e7b382">_vl_dsift_free_buffers</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Free internal buffers.  <a href="#a85a2ddc18108b83931d3cb7c66e7b382"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#af83ee4f65210d5f4476a39167802ec97">_vl_dsift_update_buffers</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates internal buffers to current geometry.  <a href="#af83ee4f65210d5f4476a39167802ec97"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#a8b3119bdf4dd078826d1fa70231184fe">_vl_dsift_alloc_buffers</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate internal buffers.  <a href="#a8b3119bdf4dd078826d1fa70231184fe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#aa9ba7ffaa72c137c457642ce833dab05">vl_dsift_new</a> (int imWidth, int imHeight)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new DSIFT filter.  <a href="#aa9ba7ffaa72c137c457642ce833dab05"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#aa025e58a852d8df078c6b74b8136c704">vl_dsift_new_basic</a> (int imWidth, int imHeight, int step, int binSize)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new DSIFT filter (basic interface)  <a href="#aa025e58a852d8df078c6b74b8136c704"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#aa123f1d9e79ab01882646f713dfb4f0c">vl_dsift_delete</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete DSIFT filter.  <a href="#aa123f1d9e79ab01882646f713dfb4f0c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#ac4c6be3c85911ea7493faa841349aff7">_vl_dsift_with_gaussian_window</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Process with Gaussian window.  <a href="#ac4c6be3c85911ea7493faa841349aff7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#a52dc36ae1f1a09fd8fa3978f973e763d">_vl_dsift_with_flat_window</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Process with flat window.  <a href="#a52dc36ae1f1a09fd8fa3978f973e763d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsift_8c.html#a09d5525ad7e16e2b9f3f1b9d273c85f6">vl_dsift_process</a> (<a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *self, float const *im)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute keypoints and descriptors.  <a href="#a09d5525ad7e16e2b9f3f1b9d273c85f6"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Andrea Vedaldi </dd>
<dd>
Brian Fulkerson </dd></dl>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a8b3119bdf4dd078826d1fa70231184fe"></a><!-- doxytag: member="dsift.c::_vl_dsift_alloc_buffers" ref="a8b3119bdf4dd078826d1fa70231184fe" args="(VlDsiftFilter *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void _vl_dsift_alloc_buffers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>DSIFT filter.</td></tr>
  </table>
  </dd>
</dl>
<p>The function (re)allocates the internal buffers in accordance with the current image and descriptor geometry. </p>

</div>
</div>
<a class="anchor" id="a85a2ddc18108b83931d3cb7c66e7b382"></a><!-- doxytag: member="dsift.c::_vl_dsift_free_buffers" ref="a85a2ddc18108b83931d3cb7c66e7b382" args="(VlDsiftFilter *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void _vl_dsift_free_buffers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>DSIFT filter. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9a99d480cf025b9f19cc3e3ee5b010c4"></a><!-- doxytag: member="dsift.c::_vl_dsift_new_kernel" ref="a9a99d480cf025b9f19cc3e3ee5b010c4" args="(int binSize, int numBins, int binIndex, double windowSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float* _vl_dsift_new_kernel </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>binSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numBins</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>binIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>windowSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">binSize</td><td></td></tr>
    <tr><td class="paramname">numBins</td><td></td></tr>
    <tr><td class="paramname">binIndex</td><td>negative to use flat window. </td></tr>
    <tr><td class="paramname">windowSize</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to new filter. </dd></dl>

</div>
</div>
<a class="anchor" id="a79f9ffc851983f7e26f09b9ed1c43813"></a><!-- doxytag: member="dsift.c::_vl_dsift_normalize_histogram" ref="a79f9ffc851983f7e26f09b9ed1c43813" args="(float *begin, float *end)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float _vl_dsift_normalize_histogram </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>begin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>end</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">begin</td><td>first element of the histogram. </td></tr>
    <tr><td class="paramname">end</td><td>last plus one element of the histogram.</td></tr>
  </table>
  </dd>
</dl>
<p>The function divides the specified histogram by its l2 norm. </p>

</div>
</div>
<a class="anchor" id="af83ee4f65210d5f4476a39167802ec97"></a><!-- doxytag: member="dsift.c::_vl_dsift_update_buffers" ref="af83ee4f65210d5f4476a39167802ec97" args="(VlDsiftFilter *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _vl_dsift_update_buffers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a52dc36ae1f1a09fd8fa3978f973e763d"></a><!-- doxytag: member="dsift.c::_vl_dsift_with_flat_window" ref="a52dc36ae1f1a09fd8fa3978f973e763d" args="(VlDsiftFilter *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _vl_dsift_with_flat_window </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>DSIFT filter object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac4c6be3c85911ea7493faa841349aff7"></a><!-- doxytag: member="dsift.c::_vl_dsift_with_gaussian_window" ref="ac4c6be3c85911ea7493faa841349aff7" args="(VlDsiftFilter *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _vl_dsift_with_gaussian_window </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>DSIFT filter. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa123f1d9e79ab01882646f713dfb4f0c"></a><!-- doxytag: member="dsift.c::vl_dsift_delete" ref="aa123f1d9e79ab01882646f713dfb4f0c" args="(VlDsiftFilter *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_dsift_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>DSIFT filter. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa9ba7ffaa72c137c457642ce833dab05"></a><!-- doxytag: member="dsift.c::vl_dsift_new" ref="aa9ba7ffaa72c137c457642ce833dab05" args="(int imWidth, int imHeight)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a>* vl_dsift_new </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>imWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>imHeight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">imWidth</td><td>width of the image. </td></tr>
    <tr><td class="paramname">imHeight</td><td>height of the image</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>new filter. </dd></dl>

</div>
</div>
<a class="anchor" id="aa025e58a852d8df078c6b74b8136c704"></a><!-- doxytag: member="dsift.c::vl_dsift_new_basic" ref="aa025e58a852d8df078c6b74b8136c704" args="(int imWidth, int imHeight, int step, int binSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a>* vl_dsift_new_basic </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>imWidth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>imHeight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>step</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>binSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">imWidth</td><td>width of the image. </td></tr>
    <tr><td class="paramname">imHeight</td><td>height of the image. </td></tr>
    <tr><td class="paramname">step</td><td>sampling step. </td></tr>
    <tr><td class="paramname">binSize</td><td>bin size. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>new filter.</dd></dl>
<p>The descriptor geometry matches the standard SIFT descriptor. </p>

</div>
</div>
<a class="anchor" id="a09d5525ad7e16e2b9f3f1b9d273c85f6"></a><!-- doxytag: member="dsift.c::vl_dsift_process" ref="a09d5525ad7e16e2b9f3f1b9d273c85f6" args="(VlDsiftFilter *self, float const *im)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_dsift_process </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlDsiftFilter.html">VlDsiftFilter</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float const *&#160;</td>
          <td class="paramname"><em>im</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>DSIFT filter. </td></tr>
    <tr><td class="paramname">im</td><td>image data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
     <!-- Doc Here -->
    </div>
   
   </div>
   <div class="clear">&nbsp;</div>
  </div> <!-- pagebody -->
  <div id="footer">
   &copy; 2007-12 Andrea Vedaldi and Brian Fulkerson
  </div> <!-- footer -->

  <!-- Google Analytics Begins -->
  <script xml:space="preserve" type="text/javascript">
   //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {
   var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
   document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
   }
   //]]>
  </script>
  <script xml:space="preserve" type="text/javascript">
    //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {

   try {
   var pageTracker = _gat._getTracker("UA-4936091-2");
   pageTracker._trackPageview();
   } catch(err) {}

   }
   //]]>
  </script>
  <!-- Google Analytics Ends -->
 </body>
</html>

 
